package com.server.model.all.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

public interface SystemEnum {

    /**
     * 黑白名单状态
     * @author LXC
     * @date 2023/2/2 15:15
     */
    @Getter
    @AllArgsConstructor
    enum blackWhiteListStateEnum implements BaseEnum{
        NONE(0,"blackWhiteList:none","无状态"),
        BACK(1,"blackWhiteList:black","黑名单"),
        WHITE(2,"blackWhiteList:white","白名单")
        ;
        private final Integer code;
        private final String redisKey;
        private final String description;

        private static final Map<Integer, blackWhiteListStateEnum> map = new HashMap<>();

        static{
            for (blackWhiteListStateEnum blackWhiteListStateEnum : blackWhiteListStateEnum.values()) {
                map.put(blackWhiteListStateEnum.getCode(), blackWhiteListStateEnum);
            }
        }

        public static blackWhiteListStateEnum getBlackWhiteListStateEnum(Integer code){
            return map.get(code);
        }

    }

    /**
     * rabbitMq 生产状态
     * @author LXC
     * @date 2023/2/2 15:15
     */
    @Getter
    @AllArgsConstructor
    enum rabbitProductionStateEnum implements BaseEnum{
        NONE(0,"无状态"),
        EXCHANGE_SUCCESS(1,"提交交换机成功"),
        EXCHANGE_FAIL(2,"提交交换机失败"),
        QUEUE_FAIL(3,"发送队列失败")
        ;
        private final Integer code;
        private final String description;

    }

    /**
     * rabbitMq 消费状态
     * @author LXC
     * @date 2023/2/2 15:15
     */
    @Getter
    @AllArgsConstructor
    enum rabbitConsumeStateEnum implements BaseEnum{
        NONE(0,"无状态"),
        SUCCESS(1,"消费成功 ack"),
        FAIL(2,"消费失败 nack"),
        UN_CONSUMABLE(3,"数据不正确,无法处理消费")
        ;
        private final Integer code;
        private final String description;

    }


}